package com.bw.service;

import com.bw.bean.User;
import com.bw.dao.UserDAO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements  UserService {

    @Resource
    private UserDAO userDAO;

    public User login(User user){

        User login = userDAO.login(user);
        return login;
    }

    @Override
    public List pList(Integer uid) {
        return userDAO.pList(uid);
    }

    @Override
    public List mList(Map map) {
        return userDAO.mList(map);
    }

    @Override
    public List userList() {
        return userDAO.userList();
    }

    @Override
    public List floorList() {
        return userDAO.floorList();
    }

    @Override
    public List dorList(Integer fid) {
        return userDAO.dorList(fid);
    }

    @Override
    public Map valid(Integer did) {
        return userDAO.valid(did);
    }

    @Override
    public int updchagne(Map map) {
        //userDAO.change(map);操作中间表有两步 1：从原宿舍中移出 2：假如新宿舍
        // 让中间表中 uid 同时outTime 为null 的那条数据调整
       int i= userDAO.updMi(map);
       int j=userDAO.addMi(map);
        return j;
    }
}
